<layout name='layout_page' />
<div class="row">
	<div class="col-lg-12">
		<div class="row">
			<div class="col-lg-12">
				<ol class="breadcrumb">
					<li><a href="<{:U('Index/index')}>">Home</a></li>
					<li class="active"><span>Appointment</span></li>
				</ol>
				<h1>Appointment Edit</h1>
			</div>
		</div>


		<div class="row">
			<div class="col-lg-8">
				<div class="main-box no-header clearfix">
					<div class="main-box-body clearfix">
						<form id="ajaxForm" action="<{:U('Appointment/update')}>" method="post" class="form-horizontal form-validata">
							<?php if($list['toID']==$userid){ ?>
							<div class="form-group menteesBase">
								<img src="<{$list['fromFace']|getFace=###}>">
								<p><{$list['fromName']}></p>
							</div>
							<?php }else{ ?>
							<div class="form-group menteesBase">
								<img src="<{$list['toFace']|getFace=###}>">
								<p><{$list['toName']}></p>
							</div>
							<?php } ?>	
							<div class="form-group">
								<label>Date</label>								
								<input type="text" class="form-control" id="date" name="date" value="<{$list['date']|date="F,d,Y",###}>" placeholder="Enter time" data-rule-required="true">
							</div>
							<script> 
							$(function(){
								$("#date" ).datepicker({
									minDate: new Date()
								});
							});
							</script>
							<div class="form-group">
								<label>Time</label>								
								<select name="time" id="time" class="form-control" data-rule-required="true">
									<option value="">Select</option>
									<option value="8:00 AM">8:00 AM</option>
									<option value="9:00 AM">9:00 AM</option>
									<option value="10:00 AM">10:00 AM</option>
									<option value="11:00 AM">11:00 AM</option>
									<option value="12:00 AM">12:00 AM</option>
									<option value="1:00 PM">1:00 PM</option>
									<option value="2:00 PM">2:00 PM</option>
									<option value="3:00 PM">3:00 PM</option>
									<option value="4:00 PM">4:00 PM</option>
									<option value="5:00 PM">5:00 PM</option>
									<option value="6:00 PM">6:00 PM</option>
									<option value="7:00 PM">7:00 PM</option>
									<option value="8:00 PM">8:00 PM</option>
									<option value="9:00 PM">9:00 PM</option>
									<option value="10:00 PM">10:00 PM</option>
								</select>
							</div>
							<div class="form-group">
								<label>Address</label>								
								<input type="text" class="form-control" id="address" name="address" value="<{$list['address']}>" data-rule-required="true">
							</div>	
							<div class="form-group">
								<input type="text" class="form-control" id="address1" name="address1" value="<{$list['address1']}>" placeholder="Apartment,State,Unit etc.(Optional)">
							</div>
							<div class="row">
								<div class="form-group col-xs-4" style="margin-right:15px;">
									<label>City</label>
									<input type="text" class="form-control" id="city" name="city" value="<{$list['city']}>" data-rule-required="true">
								</div>

								<div class="form-group col-xs-4" style="margin-right:15px;">
									<label>State</label>
									<select name="state" id="state" class="form-control" data-rule-required="true">
											<option value="">--select--</option>
											<volist name="state" id="vo">
											<option value="<{$vo.name}>"><{$vo.name}></option>
											</volist>
										</select>
								</div>

								<div class="form-group col-xs-4" style="margin-right:0;">
									<label>Zip code</label>
									<input type="text" class="form-control" name="zip" id="zip" value="<{$list['zip']}>" data-rule-required="true" data-rule-number="true" data-rule-zip="true">
								</div>				
							</div>
							<div class="form-group">
								<label for="exampleTextarea">Message</label>
								<textarea class="form-control" name="content" id="content" rows="5" data-rule-required="true"><{$list['content']}></textarea>
							</div>	
							<div class="form-group">				
								<button type="submit" id="myBtn" class="btn btn-success">Edit Appointment</button>	
							</div>
							<input type="hidden" name="id" value="<{$list['id']}>">
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
	ajaxForm();
	$("#time").val("<{$list.time}>");
	$("#state").val("<{$list.state}>");
})
</script>